<?php

class Application_Form_Registration extends Zend_Form
{

    public function init()
    {
        $this->setMethod('post');
                
        $this->addElement('text', 'givenname',array(
            'label'     => 'First name: ',
            'required'   => true,
            'filters'    => array('StringTrim'),
            'validators' => array(
                array('StringLength', false, array(1, 45)),
                ),
        ));
        
        $this->addElement('text', 'familyname', array(
            'label'      => 'Surname: ',
            'required'   => true,
            'filters'    => array('StringTrim'),
            'validators' => array(
                array('StringLength', false, array(1, 45)),
            ),
        ));

        // Veld 'E-mailadres'
        $this->addElement('text', 'email', array(
            'label'      => 'Email: ',
            'required'   => true,
            'filters'    => array('StringTrim'),
            'validators' => array('EmailAddress'),
        ));

        // Veld 'Wachtwoord'
        $this->addElement('password', 'password', array(
            'label'      => 'Password: ',
            'required'   => true,
            'filters'    => array('StringTrim'),
            'validators' => array(
                array('StringLength', false, array(8, 45)),
            ),
        ));

        // Veld 'Wachtwoord (herhaal)'
        $this->addElement('password', 'passwordRepeat', array(
            'label'      => 'Repeat password: ',
            'required'   => true,
            'filters'    => array('StringTrim'),
            'validators' => array(
                array('StringLength', false, array(8, 45)),
                array('Identical', true, array('password')),
            ),
        ));

        // Knop 'Versturen'
        $this->addElement('submit', 'send', array(
            'label'      => 'Register',
        ));

        // CSRF-preventie (Cross-Site Request Forgery)
        $this->addElement('hash', 'no_csrf_registration', array(
            'salt' => 'unique',
        ));
    }


}

